from django.db import models
from django_html5_forms import fields

def html5(f):
    if isinstance(f, models.URLField):
        return fields.URLField(f)
    elif isinstance(f, models.SlugField):
        return fields.SlugField(f)
    else:
        return f.formfield()